home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Js / AgentDemo.js < prev    next >
Encoding:
JavaScript  |  2003-06-24  |  6.9 KB  |  236 lines

  1. /* ======================================================================
  2. DESC: Demo Agent Routines
  3.  
  4. PLATFORMS: >= MS IE 4.0
  5. USAGE NOTES: 
  6. ====================================================================== */
  7. var AgentType = "Genie";
  8. var AlertAgentType = "Peedy";
  9. var MAgntOffsetItem = 30; // For Merlin use 50; for Genie use 30
  10. var MAgntOffsetSection = 75;
  11. var Merlin = null; // Global Merlin object
  12. var AlertAgent = null; 
  13. var TutorAgentRequest = null;
  14. var AlertAgentRequest = null;
  15. var TutorAgentLoadStarted = false;
  16. var AlertAgentLoadStarted = false;
  17.  
  18. function processDemoAgentInit() {
  19.  
  20.     // Set up the Tutorial & Help Agent
  21.     AgentControl.Connected = true;    
  22.     if ( (AgentType != AlertAgentType) || (AlertAgent == null && AlertAgentLoadStarted == false) ) { // check if Character already loaded
  23.         fs = "http://"+document.body.RPMHostIP+":"+document.body.RPMHttpPort;    
  24.         MAgntOffsetItem = 30; // defaults
  25.         MAgntOffsetSection = 50;
  26.         MAgntOffsetTreeItem = 20;
  27.         TutorAgentLoadStarted = true;
  28.         if ( AgentType == "Merlin" ) {
  29.             TutorAgentRequest = AgentControl.Characters.Load("Merlin", fs+"/MSChars/Merlin/merlin.acf");
  30.             MAgntOffsetItem = 50; 
  31.             MAgntOffsetTreeItem = 50;
  32.         }
  33.         else if ( AgentType == "Genie" ) {
  34.             TutorAgentRequest = AgentControl.Characters.Load("Genie", fs+"/MSChars/Genie/genie.acf");
  35.             MAgntOffsetSection = 75;
  36.         }
  37.         else if ( AgentType == "Peedy" ) {
  38.             TutorAgentRequest = AgentControl.Characters.Load("Peedy", fs+"/MSChars/Peedy/peedy.acf");
  39.             MAgntOffsetTreeItem = 50;
  40.         }
  41.         else {
  42.             TutorAgentRequest = AgentControl.Characters.Load("Robby", fs+"/MSChars/Robby/robby.acf");
  43.         }
  44.     }
  45.     else {
  46.         Merlin = AlertAgent;
  47.     }
  48. }
  49. function processDemoAgentRelease() {
  50.  
  51.     if ( AgentType != AlertAgentType ) { // check if Character used by Alert
  52.         if ( Merlin != null ) {
  53.             AgentControl.Characters.Unload(AgentType);
  54.             Merlin = null;
  55.         }
  56.     }
  57.     AgentType = null;
  58. }
  59.  
  60. function processAlertAgentInit() {
  61.  
  62.     // Set up the Alert Agent
  63.     AgentControl.Connected = true;    
  64.     if ( (AgentType != AlertAgentType) || (Merlin == null && TutorAgentLoadStarted == false) ) { // check if Character already loaded
  65.         fs = "http://"+document.body.RPMHostIP+":"+document.body.RPMHttpPort;    
  66.         AlertAgentLoadStarted = true;
  67.         if ( AlertAgentType == "Merlin" ) {
  68.             AlertAgentRequest = AgentControl.Characters.Load("Merlin", fs+"/MSChars/Merlin/merlin.acf");
  69.         }
  70.         else if ( AlertAgentType == "Genie" ) {
  71.             AlertAgentRequest = AgentControl.Characters.Load("Genie", fs+"/MSChars/Genie/genie.acf");
  72.         }
  73.         else if ( AlertAgentType == "Peedy" ) {
  74.             AlertAgentRequest = AgentControl.Characters.Load("Peedy", fs+"/MSChars/Peedy/peedy.acf");
  75.         }
  76.         else {
  77.             AlertAgentRequest = AgentControl.Characters.Load("Robby", fs+"/MSChars/Robby/robby.acf");
  78.         }
  79.     }
  80.     else {
  81.         AlertAgent = Merlin;
  82.     }
  83. }
  84. function processAlertAgentRelease() {
  85.     if ( AgentType != AlertAgentType ) { // check if Character used by Tutorial&Help
  86.         if ( AlertAgent != null ) {
  87.             AgentControl.Characters.Unload(AlertAgentType);
  88.             AlertAgent = null;
  89.         }
  90.     }
  91.     AlertAgentType = null;
  92. }
  93.  
  94.  
  95. function MerlinAssistance() {
  96.       DemoMode = false;
  97.     return;
  98.     if ( DemoMode ) { // if in Demo mode
  99.         switch ( CurrentPageName ) {
  100.        case "RpmIntro" : 
  101.             top.main.ActionPane.processMerlinIntroDemo();
  102.           break;
  103.        case "AnalyzeCharts" : 
  104.             top.main.ActionPane.processMerlinAnalyzeChartsDemo();
  105.           break;
  106.        case "AdminReports" : 
  107.           top.main.ActionPane.processMerlinAdminReportsDemo();
  108.           break;
  109.       default :
  110.           DemoMode = false;
  111.         }
  112.     }
  113. }
  114.  
  115. // Agent Help
  116. function goPlayHelp() {
  117.     switch ( CurrentPageName ) {
  118.       case "RpmIntro" : 
  119.       case "AnalyzeCharts" : 
  120.       case "AdminReports" : 
  121.       case "AdminAlerts" : 
  122.       case "AdminComputers" : 
  123.       case "AdminDataBase" : 
  124.       case "AdminGroups" : 
  125.       case "AdminMonServer" : 
  126.       case "AdminPreferences" : 
  127.       case "AdminSecurity" : 
  128.       case "AdminServers" : 
  129.       case "ReviewActiveCounters" : 
  130.       case "SchedReports" : 
  131.       case "SchedMonitoring" : 
  132.      case "ServerWatch" : 
  133.       case "ViewReports" : 
  134.       case "ViewAlerts" : 
  135.       case "FirstTimeSteps" : 
  136.       case "ViewEventLogs" : 
  137.       case "AdminOIDs" : 
  138.       case "ViewTools" : 
  139.       case "AdminDomains" : 
  140.       case "ViewSNMPTrapDisplay" : 
  141.       case "ViewSyslogDisplay" : 
  142.       case "ViewEventlogDisplay" : 
  143.       case "ViewNetStatus" : 
  144.       case "ViewMemoryStatus" : 
  145.       case "ViewHDDStatus" : 
  146.          top.banner.resetBannerCursor();
  147.         showHelp("Help/"+CurrentPageName+"_Help.htm");
  148.          break;
  149.    default :
  150.    /*
  151.         if ((MAgnt = top.banner.Merlin) == null) // preloaded Agent character
  152.             return; // exit if not defined
  153.         setBannerCursor(); 
  154.         MAgnt.LanguageID = 0x0409;
  155.         MAgnt.Get("state", "Hiding");
  156.         MAgnt.Get("state", "Showing, Speaking");
  157.         MAgnt.Get("animation", "Read, Confused");
  158.         MAgnt.MoveTo(top.banner.bX+(top.banner.bCw>>1)-80,top.banner.bY,0); // top/center Merlin
  159.         MAgnt.Show();
  160.         MAgnt.Play("Read");
  161.         MAgnt.Play("ReadReturn");
  162.         MAgnt.Play("Confused");
  163.         MAgnt.Speak('I apologize but I cannot seem to find the \\Map="Monitor It"="MonitorIT"\\ help you need. It is not implemented yet.');
  164.         MAgnt.Speak(' \\Mrk=300\\ ');
  165.         MAgnt.Hide();
  166.         break;
  167.     */
  168.     }
  169. }
  170.  
  171.  
  172. function setBannerCursor() {
  173.     document.body.style.cursor='wait'; 
  174.     top.main.ActionPane.document.body.style.cursor = 'wait';
  175.     /*
  176.     if ( CurrentPageName == "RpmIntro" ) {
  177.         top.main.ActionPane.HelpClickUnderL.style.cursor = 'wait';       
  178.         top.main.ActionPane.HelpClickImg.style.cursor = 'wait';       
  179.     }
  180.     */
  181. }
  182.  
  183. function resetBannerCursor() {
  184.     document.body.style.cursor = "auto";
  185.     top.main.ActionPane.document.body.style.cursor = 'auto';
  186.     /*
  187.     if ( CurrentPageName == "RpmIntro" ) {
  188.         top.main.ActionPane.HelpClickUnderL.style.cursor = 'hand';       
  189.         top.main.ActionPane.HelpClickImg.style.cursor = 'hand';       
  190.     }
  191.     */
  192. }
  193.  
  194.  
  195. function processMerlinBookmarks(bid) {
  196.     if ( bid == 1 ) {
  197.        top.main.ActionPane.WelIP = false; // reset Welcome in progress
  198.    }
  199.      /*
  200.      else if ( bid == 2 ) {
  201.          if (top.main.ActionPane.document.title == "View Alerts") {
  202.            top.main.ActionPane.freeAudioOut(); // reset Audio free in View Alerts
  203.        }
  204.    }
  205.    */
  206.    else if ( bid == 10 ) {
  207.        top.main.ActionPane.SetCursor("auto"); // restore cursor
  208.        top.main.ActionPane.SetClickCursor("hand"); // restore cursor
  209.       }
  210.       /*
  211.     else if ( bid >=200 && bid <= 299 ) {
  212.         top.main.ActionPane.processRpmIntroBookmarks(bid);
  213.     }
  214.     else if ( bid == 300 ) {
  215.          top.banner.resetBannerCursor();
  216.     }
  217.     else if ( bid >=301 && bid <= 399 ) {
  218.         top.main.ActionPane.processViewChartsBookmarks(bid);
  219.     }
  220.     else if ( bid >=401 && bid <= 499 ) {
  221.         top.main.ActionPane.processAdminReportsBookmarks(bid);
  222.     }
  223.     */
  224. }
  225.  
  226. function GetIntroFirstTime() {
  227.     return true;        
  228.     //return ( ( RpmCC_Ban.RegGetKey("Intro") == "Played" ) ? false : true );
  229. }
  230. function SetIntroFirstTime(stat) {
  231.     stat = ( stat ) ? "NotPlayed" : "Played";
  232.     //RpmCC_Ban.RegSetKey("Intro", stat);
  233. }
  234.  
  235.  
  236.